﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Pages_PagoCons : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (User.IsInRole(@"COSTARICA\CR_Intranet_Financiero.R") || User.IsInRole(@"GRUPOBANACOL\CR_Intranet_Financiero.R"))
            {
                txtDesde.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnBuscar.UniqueID + "').click();return false;}} else {return true}; ");
                txtHasta.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnBuscar.UniqueID + "').click();return false;}} else {return true}; ");
                txtFiltro.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnBuscar.UniqueID + "').click();return false;}} else {return true}; ");
                Label lblTituloMaster = new Label();
                lblTituloMaster = (Label)this.Form.Parent.FindControl("lblTitulo");
                lblTituloMaster.Text = "Intranet-Consulta de Pagos a Proveedores";
                txtDesde.Text = "01/01/2000";
                txtHasta.Text = DateTime.Today.ToShortDateString();
            }
            else
            {
                Response.Redirect("~/Pages/PaginaMensaje.aspx?Msj=Lo sentimos. Usted no tiene autorización para ingresar a esta página.");
            }
        }
        Page.SetFocus(txtFiltro);
    }
}
